package com.gd.iot.energy.controller.datamanage;

import com.gd.iot.energy.annotation.SystemLogRecordMonitor;
import com.gd.iot.energy.entity.ResponseEntity;
import com.gd.iot.energy.pojo.common.vo.PageVO;
import com.gd.iot.energy.pojo.statistics.vo.AllDataCallPageVO;
import com.gd.iot.energy.service.datamanage.AllDataCallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据管理-数据召测-数据召测
 *
 * @author kris
 * @date Created at 2020/8/14 10:50
 */
@Api(value = "数据管理-数据召测-数据召测", tags = "数据管理-数据召测-数据召测")
@RestController
@RequestMapping("/admin/allDataCall")
public class AllDataCallController {

    @Autowired
    private AllDataCallService allDataCallService;

    @ApiOperation("数据召测分页列表")
    @SystemLogRecordMonitor("数据召测分页列表")
    @PostMapping("/allDataCall")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "areaId", value = "区域id", dataType = "string", paramType = "query", example = "", required = false),
            @ApiImplicitParam(name = "pageSize", value = "每页数量", dataType = "string", paramType = "query", example = "", required = false),
            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "string", paramType = "query", example = "", required = false),
    })
    public ResponseEntity<PageVO<AllDataCallPageVO>> allDataCall(
            @RequestParam(value = "areaId", required = false) Integer areaId,
            @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize,
            @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum) {
        PageVO<AllDataCallPageVO> pageVO = allDataCallService.allDataCall(areaId,pageSize,pageNum);
        return new ResponseEntity<>(pageVO);
    }
}
